package com.radon.api;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 分布式配置中心测试
 */
@RestController
@RefreshScope //实时刷新配置 post调用actuator/refresh接口进行刷新本地缓存
public class ConsumptionConfigApi {

    @Value("${springCloudLearning}") //此要与git中配置文件的key保持一致
    private String key;

    /**
     * 获取配置
     * @return
     */
    @RequestMapping("/getInfo")
    public String getInfo() {
        return key;
    }
}
